<?php
Yii::import('zii.widgets.CPortlet'); 
class BestIdeasWidget extends CPortlet
{
    /**
    * Limit record to displayed
    * 
    * @var mixed
    */
    public $limit=5;
    /**
    * Number of first words can be displayed
    * 
    * @var mixed
    */
    public $firstWord=150;
    
    public function getBestIdeas(){
        return Post::model()->findBestIdeas($this->limit);
    }

    protected function renderContent()
    {
        $this->render('bestIdeas');
    }
}
